import requests



# 添加员工
resp = requests.post(url="http://ihrm-test.itheima.net/api/company/department",
                     headers={"Content-Type": "application/json",
                              "Authorization": "ad7ebdd8-36ed-4c8d-b987-78097cecc4b4"},
                     json={"name": "测试部", "code": "666"})
print(resp.json())

# 查询员工
resp = requests.get(url="http://ihrm2-test.itheima.net/api/company/department/:id",
                    headers={"Authorization": "e1438c1c-58e0-4efa-adb4-2db920768e43"})
print(resp.json())

# 修改员工
resp = requests.put(url="http://ihrm2-test.itheima.net/api/company/department/:id",
                    headers={"Content-Type": "application/json",
                             "Authorization": "ad7ebdd8-36ed-4c8d-b987-78097cecc4b4"},
                    json={"name": "测试部", "code": "666"})
print(resp.json())

# 删除员工
resp = requests.delete(url="http://ihrm2-test.itheima.net/api/company/department/:id",
                       headers={"Authorization": "ad7ebdd8-36ed-4c8d-b987-78097cecc4b4"})
print(resp.json())
